<div class="problemindexholder" problemindex="B">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     B. The number on the board
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     2 seconds
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     Some natural number was written on the board. Its sum of digits was not less than
     <span class="tex-span">
      <i>
       k
      </i>
     </span>
     . But you were distracted a bit, and someone changed this number to
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     , replacing some digits with others. It's known that the length of the number didn't change.
    </p>
    <p>
     You have to find the minimum number of digits in which these two numbers can differ.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     The first line contains integer
     <span class="tex-span">
      <i>
       k
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       k
      </i>
      ≤ 10
      <sup class="upper-index">
       9
      </sup>
     </span>
     ).
    </p>
    <p>
     The second line contains integer
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       n
      </i>
      &lt; 10
      <sup class="upper-index">
       100000
      </sup>
     </span>
     ).
    </p>
    <p>
     There are no leading zeros in
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     . It's guaranteed that this situation is possible.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Print the minimum number of digits in which the initial number and
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     can differ.
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>3<br/>11<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>1<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>3<br/>99<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>0<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     In the first example, the initial number could be
     <span class="tex-span">
      12
     </span>
     .
    </p>
    <p>
     In the second example the sum of the digits of
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     is not less than
     <span class="tex-span">
      <i>
       k
      </i>
     </span>
     . The initial number could be equal to
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     .
    </p>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
